#pragma once

inline unsigned char getbit(unsigned char c, int pos)
{
	return (c >> pos) & 1;
}

inline unsigned char revbit(unsigned char x)
{
	x = (((x & 0x0f) << 4) | ((x & 0xf0) >> 4));
	x = (((x & 0x33) << 2) | ((x & 0xcc) >> 2));
	x = (((x & 0x55) << 1) | ((x & 0xaa) >> 1));
	return (x >> 1);
}
inline unsigned char notbit(unsigned char c)
{
	return (~c) & 0x7f;
}
inline unsigned char kepbit(unsigned char c)
{
	return c;
}
